CREATE PROCEDURE dbo.LeadInsertModel
	@Title NVARCHAR(127),
	@OwnerKey INT,
	@LeadTypeKey INT,
	@LeadStatusKey INT, 
	@Audit_UserKey INT
AS
	SET NOCOUNT ON

	INSERT INTO dbo.Lead (
		Title,
		OwnerKey,
		CreatedByKey,
		CreatedDate,
		UpdatedByKey,
		UpdatedDate,
		LeadTypeKey,
		LeadStatusKey
	) VALUES (
		@Title,
		@OwnerKey,
		@Audit_UserKey,
		GetDate(),
		@Audit_UserKey,
		GetDate(),
		@LeadTypeKey,
		@LeadStatusKey
	)

	DECLARE @LeadKey INT = Scope_Identity()
	EXEC dbo.LeadSelectModel @LeadKey = @LeadKey, @Audit_UserKey = @Audit_UserKey

RETURN 0
